import imp


import cv2

# author: 钟勇
# 图像灰度与二值化


class Binary:
    @staticmethod
    def binary_pic(image):
        gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
        _, bin = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY)
        return bin
